package src.origintrail;

/**
 * A node representing a location on a map in OriginTrail
 * @author cassidy
 *
 */
public class MapNode 
{
	private String name;
	private int distance;
	private boolean hasShop;
	private boolean hasRiver;
	private boolean isEnd;
	private int distanceToNext;
	

	/**
	 * Creates a map node and sets the distance between it and the node before it
	 * @param name name of the location
	 * @param dist distance from the last node
	 * @param shop whether or not a shop is present at this location
	 * @param river whether or not a river is present at this location
	 */
	public MapNode(String name, int dist, int shop,int river)
	{
		this.name = name;
		this.distance = dist;
		this.hasShop = shop == 1;
		this.hasRiver = river == 1;
		this.isEnd = dist == 0;
		this.distanceToNext = distance;
		
	}
	/**
	 * 
	 * @param e
	 */
	public MapNode(Event[] e)
	{

	}
	/**
	 * @return distance between this mapnode and the last mapnode
	 */
	public int getDistance() 
	{
		return distance;
	}
	/**
	 * graps the name of the location represented by the node
	 * @return name
	 */
	public String getName() {
		return name;
	}

	/**
	 * whether or not this location has a river
	 * @return hasRiver
	 */
	public boolean hasRiver() {
		return hasRiver;
	}
	
	/**
	 * whether or not this location has a shop
	 * @return hasShop
	 */
	public boolean hasShop() 
	{
		return hasShop;
	}


	/**
	 * Getter
	 * @return isEnd   end of the trail
	 */
	public boolean isEnd() {
		return isEnd;
	}
	/**
	 * Getter
	 * @return distanceToNext
	 */
	public int getDistanceToNext()
	{
		return this.distanceToNext;
	}
	/**
	 * Setter
	 * @param dist distance to set it to
	 */
	public void setDistanceToNext(int dist)
	{
		this.distanceToNext = dist;
	}

}


